//
//  ExcCollectionViewCell.m
//  212--Homework  QQy音乐  阿里星球
//
//  Created by 冀永金 on 16/8/13.
//  Copyright © 2016年 冀永金. All rights reserved.
//

#import "ExcCollectionViewCell.h"
#import "UIImageView+WebCache.h"
#import "ThirdModel.h"
@interface ExcCollectionViewCell ()
@property (nonatomic ,strong) UIImageView *imageOfView;
@property (nonatomic, strong) UILabel *firstLabel;
@property (nonatomic, strong) UILabel *secondLabel;

@end
@implementation ExcCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.imageOfView = [[UIImageView alloc]init];
        [self.contentView addSubview:_imageOfView];
        self.firstLabel = [[UILabel alloc]init];
        [self.contentView addSubview:_firstLabel];
        _firstLabel.textColor = [UIColor whiteColor];
        
        self.secondLabel = [[UILabel alloc]init];
        [self.contentView addSubview:_secondLabel];
        self.secondLabel.numberOfLines = 0;
        self.secondLabel.textColor = [UIColor whiteColor];
    }
    return self;
}
- (void)layoutSubviews {
    [super layoutSubviews];
    self.imageOfView.frame = CGRectMake(0, 5, self.contentView.frame.size.width/3,self.contentView.frame.size.height-10 );
    self.firstLabel.frame = CGRectMake(self.contentView.frame.size.width/3 + 5, 5, self.contentView.frame.size.width*2/3,self.contentView.frame.size.height/2);
    self.secondLabel.frame = CGRectMake(self.contentView.frame.size.width/3 + 5, 5+self.contentView.frame.size.height/2, self.contentView.frame.size.width*2/3,self.contentView.frame.size.height/2);
}
- (void)setThird:(ThirdModel *)third {
    _third = third;
    [self.imageOfView sd_setImageWithURL:[NSURL URLWithString:third.picUrl] placeholderImage:[UIImage imageNamed:@"dongting"]];
    self.firstLabel.text = third.name;
    self.secondLabel.text = third.desc;
}
@end
